package lianxi01;

import java.util.Scanner;

public class LianXi1 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入学生姓名：");
        String name = input.next();

       double num = 0;
       double sum = 0 ;
       boolean flag=true;
        Scanner inpot = new Scanner(System.in);
        for (int i=1;i<=5;i++){
            System.out.println("请输入第五门功课中第"+i+"门课的成绩：");
            num= inpot.nextDouble();
            if (num<0){
                System.out.println("录入错误");
                break;
            }
            sum = sum+num;
        }


            System.out.println("王军的平均分是："+sum/5);


    }
}
